from api.ihrm_api import IHRMAPI


class TOKENUTIL:

    # 封装提取token的方法
    @classmethod
    def get_token(cls):
        body={"mobile": "13800000002","password": "123456"}
        resp=IHRMAPI.login(body)

        token=resp.json().get("data")
        # 从响应结果提取token
        return token
    # 要token结果一定要return


if __name__ == '__main__':
    token=TOKENUTIL.get_token()
    print(token)